
package nav;

import java.util.Collection;
import java.util.HashMap;

public class LinkCollectionImpl implements LinkCollection {
	
	private HashMap<Integer, Link> links = new HashMap<Integer, Link>();
	
    public LinkCollectionImpl(){

    }

	@Override
	public void addLink(Link link) {
		links.put(link.getID(), link);
	}

	@Override
	public Link getLink(int id){
		return links.get(id);
	}

	@Override
	public Collection<Link> getAllLinks(){
		return links.values();
	}

	@Override
	public void clear() {
		links.clear();
	}    
}
